package com.zzyl.controller;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.entity.NursingLevel;
import com.zzyl.service.NursingLevelService;
import com.zzyl.vo.NursingProjectVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/nursingLevel")
public class NursingLevelController extends BaseController{

    @Resource
    NursingLevelService nursingLevelService;
    @GetMapping("listAll")
    public ResponseResult listAll() {
        return ResponseResult.success(nursingLevelService.listAll());
    }

    @GetMapping("/listByPage")
    public ResponseResult listByPage(@RequestParam(required = false) String name,
                                     @RequestParam("pageNum") Integer pageNum,
                                     @RequestParam("pageSize") Integer pageSize,
                                     @RequestParam(required = false) Integer status) {
        PageResponse<NursingLevel> query = nursingLevelService.listByPage(name, status, pageNum, pageSize);
        return success(query);
    }
}
